package cn.bytecollege.user.controller;

import cn.bytecollege.user.service.OrderDetailService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(name = "OederDetailDeleteController",value = "/user/orderdelete")
public class OederDetailDeleteController extends HttpServlet {
    OrderDetailService orderDetailService=null;
    public OederDetailDeleteController(){
        orderDetailService=new OrderDetailService();


    }
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    String Id=request.getParameter("id");
    orderDetailService.deleteById(Integer.valueOf(Id));
    response.sendRedirect("/user/orderlist");

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
     doPost(request, response);
    }
}
